/* xbiss.h */

#ifndef XBI_SS
#define XBI_SS 1

#include <xbi/xbicommon.h>
#include <xbi/xbiccrt.h>
#include <xbi/xbipfi.h>

#define _XBISSAuthoringSystemIDLength 16
#define _XBISSMasteringSystemIDLength 16

typedef enum {
    kXBIXbox1SS,
    kXBIXbox360SS
} XBISSVersion;

typedef struct _XBISecuritySector XBISecuritySector;

// Creation - Copy - Deletion
XBISecuritySector * XBISSCreateFromBuffer(byte_t * buffer, int size, XBIError * error);
XBISecuritySector * XBISSCreateFromFile(FILE * file, XBIError * error);
XBISecuritySector * XBISSCopy(XBISecuritySector * ss);
void XBISSDelete(XBISecuritySector * ss);

// Data manipulation
off_t XBISSGetDataPartitionStart(XBISecuritySector * ss);
off_t XBISSGetDiscSize(XBISecuritySector * ss);
uint32_t XBISSGetCRC32(XBISecuritySector * ss);

// Accessors
time_t XBISSGetAuthoringDate(XBISecuritySector * ss);
byte_t * XBISSGetMediaID(XBISecuritySector * ss);
byte_t * XBISSGetData(XBISecuritySector * ss);
size_t XBISSGetSize(XBISecuritySector * ss);
XBIPhysicalFormatInformation * XBISSGetPFI(XBISecuritySector * ss);

#endif
